<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/grsun" prefix="grsun"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>代理商首页</title>
<%@ include file="/static/myjs/information/home/home_include.jsp"%>
</head>
<body>
	<div id="main">
		<div id="currency">
			<div class="icon">
				<i class="iconfont icon-qian"></i>
			</div>
			<div class="currency">
				<div class="currency-left" style="width:47%">
					<p>账户金额</p>
					<b>￥</b>
					<a href="#" id="myBusinessmoneyrecord">
					<i id="balance">${agent.balance}</i>
					</a>
				</div>
				<div class="currency-center">
					<p>
						订单总数量&nbsp;&nbsp;
						<a href="javascript:void(0)">
						<i>${pd.orderCount }</i>
						</a>
						&nbsp;&nbsp;笔
					</p>
					<p>
						订单总金额&nbsp;&nbsp;
						<a href="javascript:void(0)">
						<i>${empty pd.orderAmount?0:pd.orderAmount }&nbsp;元</i>
						</a>
					</p>
					<p>
						微信支付&nbsp;&nbsp;
						<a href="javascript:void(0)">
						<i>${ empty pd.wxOrderAmount?0:pd.wxOrderAmount  }&nbsp;元</i>
						</a>
					</p>
					<p>
						支付宝支付&nbsp;&nbsp;
						<a href="javascript:void(0)">
						<i>${ empty pd.aliOrderAmount?0:pd.aliOrderAmount  }&nbsp;元</i>
						</a>
					</p>
				</div>
				<div class="currency-right">
					<a href="">
						<i class="iconfont icon-shuaxinrefresh39"></i>
						<b>刷新</b>
					</a>
					<a href="#" id="toAgentWithdraw">
						<i class="iconfont icon-tixian"></i>
						<b>提现</b>
					</a>
				</div>
			</div>
		</div>
		 
	</div>
	<script type="text/javascript">
		$(function() {
			$('#toAgentWithdraw').on('click', function() {
				if (parseFloat($('#balance').text()) > 0) {
					layer.open({
						title : '提现',
						type : 2,
						area : [ '70%', '70%' ],
						content : rootpath + '/hhWithdrawAgent/toAgentWithdraw.do'
					});
				} else {
					layer.msg('余额不足！');
				}
			})
			
			 

			$('#myBusinessmoneyrecord').on('click', function() {
				window.parent.addTab('myBusinessmoneyrecordId', '账户明细', rootpath + '/home/toAgentRecordList.do', 'fa-star', 'myBusinessmoneyrecordId');
			})
 
			

		})
	</script>
</body>
</html>